home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
remote
/
mult200.zip
/
BBS.BAT
next >
Wrap
DOS Batch File
|
1991-12-10
|
13KB
|
508 lines
@echo off
if .%1 == .reload goto loadra
cls
if not exist c:\ra\%node%load.txt goto ok2load
echo.
echo
echo The system shows that Node %node% is already loaded!
echo.
echo If you KNOW that Node %node% is not loaded and is being
echo brought back up after a crash (closing down the DV window
echo without exiting FD correctly ie: ALT C Y), then you need
echo to go to your RA directory delete the %node%LOAD.TXT file
echo and create the %node%ISDOWN.TXT file. Then you can reload
echo this Node.
echo.
echo Press [ENTER] to close this Task down.
pause
goto endok3
:ok2load
if %node% == N1 set port=1
if %node% == N2 set port=2
if %node% == N3 set port=0
echo.
echo Selected Port is %port%.
echo.
set fd=c:\fd\%node%
set fdovr=c:\fd
set fmovr=c:\fd
set fdopt=INTL
set ra=c:\ra
set raovr=c:\ra
set imail=c:\ra
set mbu=c:\ra\mbutil.ctl
echo.
echo Checking for DESQview.
dvactive
if errorlevel 1 goto dvstuff
echo.
echo DESQview NOT detected.
echo Loading ANSI driver and FOSSIL driver..
c:\dv\dvansi
bnu /f+ /m- /q
bnu /c
goto start
:dvstuff
echo.
echo DESQview Detected!
echo Loading ANSI driver and Recapturing the FOSSIL interrupt...
echo.
c:\dv\dvansi
bnu /c
:start
echo.
echo Removing old %node% lockout files.
if exist c:\ra\%node%*.txt del c:\ra\%node%*.txt
if exist c:\ra\%node%\dobbs.bat del c:\ra\%node%\dobbs.bat
rem>c:\ra\%node%load.txt
echo.
echo Node %node% is going back online!
c:
cd\ra\%node%
if %node% == N3 goto ralocal
c:\fd\fd.exe
if errorlevel 255 goto diffexit
if errorlevel 240 set baud=2400
if errorlevel 240 goto racall
if errorlevel 120 set baud=1200
if errorlevel 120 goto racall
if errorlevel 110 set baud=300
if errorlevel 110 goto racall
if errorlevel 101 goto outbound
if errorlevel 100 goto inbound
if errorlevel 40 goto ralocal
if errorlevel 33 goto nightly
if errorlevel 31 goto weekly
if errorlevel 10 goto endok
if errorlevel 1 goto enderror
:diffexit
dtr com%port%: on
at com%port%: h1
echo.
echo Notifying other nodes that I'm DOWN....
rem>c:\ra\%node%down.txt
goto endok2
:racall
cls
echo.
echo We have a caller!
if exist c:\ra\N?toss.txt goto fdbusy
rem>c:\ra\%node%isup.txt
if not exist c:\ra\%node%\dobbs.bat goto loadra
dobbs.bat
:loadra
ra -%node% -C%port% -B%baud% -E20 %event%
:afterra
echo.
echo Checking Remote Access Exit Errorlevels....
if errorlevel 20 goto update
if errorlevel 11 goto ldv
if errorlevel 5 goto outbound
if errorlevel 4 goto outbound
if errorlevel 3 goto outbound
if errorlevel 2 goto ralocal
if errorlevel 1 goto enderror
if errorlevel 0 goto endok
:ldv
echo.
echo Running Long Distance Verifier.
ldv
echo.
echo Notifying User of making sure to leave SysOp Feedback
echo so I can make sure I mail him his special LDV password.
echo.>com%port%:
echo.>com%port%:
echo Please leave me a message stating that you had to use LDV>com%port%:
echo so you could have access to this system. If you don't tell>com%port%:
echo me, it will take longer for you to get your letter.>com%port%:
echo.>com%port%:
echo This option isn't used very much and i don't check it>com%port%:
echo very often.>com%port%:
echo.>com%port%:
echo Thank you,>com%port%:
echo Sysop>com%port%:
dvcomand wait 50
goto restart
:restart
echo.
echo Reloading RA after a type 15 exit...
c:
cd\ra\%node%
ra -R -G -E20 -%node% -C%port% -B%baud%
goto afterra
:inbound
cls
echo.
echo We have inbound mail!
echo.
if exist c:\ra\N?toss.txt goto innodechk
if exist c:\ra\n3inchck.txt goto 3upin
if exist c:\ra\n2inchck.txt goto 2upin
if exist c:\ra\n1inchck.txt goto 1upin
if exist c:\ra\N3outchk.txt goto 3upin
if exist c:\ra\N1outchk.txt goto 2upin
if exist c:\ra\N2outchk.txt goto 1upin
if %node% == N1 goto downthisnode
if %node% == N2 goto downthisnode
if %node% == N3 goto 3upin
:innodechk
echo.
echo Another node is already Tossing INBOUND mail.
echo Waiting till later...
if %node% == N1 goto start
if %node% == N2 goto start
if %node% == N3 del c:\ra\%node%*.txt
If %node% == N3 goto end
:downthisnode
dtr com%port%: off
dtr com%port%: on
at com%port%: h1
if %node% == N1 goto 2upin
if %node% == N2 goto 1upin
:3upin
if exist c:\ra\N1isup.txt goto 3upin1
if exist c:\ra\N2isup.txt goto 3upin1
goto tossit
:3upin1
rem > c:\ra\mail!.txt
if exist c:\ra\%node%*.txt del c:\ra\%node%*.txt
goto end
:2upin
if exist c:\ra\N2isup.txt goto 2upin1
if exist c:\ra\N3isup.txt goto 2upin1
goto tossit
:2upin1
rem > c:\ra\mail!.txt
goto start
:1upin
if exist c:\ra\N1isup.txt goto 1upin1
if exist c:\ra\N3isup.txt goto 1upin1
goto tossit
:1upin1
rem > c:\ra\mail!.txt
goto start
:tossit
echo.
echo Locking out other nodes for the Tossing of INBOUND mail...
rem>c:\ra\%node%toss.txt
echo.
echo Making sure phone is OFF the hook...
dtr com%port%: off
dtr com%port%: on
at com%port%: h1
echo.
echo Looking to see what we got. Don'cha love christmas -=B-)
c:
cd\fd\files\news
if not exist ..\fnews???.* goto nodelist
echo.
echo Found new FIDO Snooze. Unpacking it...
spaz -d ..\fnews*
:nodelist
cd\fd\nodelist
if exist c:\fd\files\nodediff.* goto fidodiff
goto unpackmail
:fidodiff
echo.
echo Found a new FIDOnet NodeDiff....
:nodechker
if %node% == N1 goto diffn1
if %node% == N2 goto diffn2
if %node% == N3 goto diffn3
:diffn1
rem>c:\fd\n2\fdexit.255
:1diffn1
if not exist c:\ra\n2down.txt goto n1wait
goto dofidodiffs
:n1wait
echo.
echo Waiting for Node N2 to go down...
dvcomand wait 50
goto 1diffn1
:diffn2
rem>c:\fd\n1\fdexit.255
:2diffn2
if not exist c:\ra\n1down.txt goto n2wait
goto dofidodiffs
:n2wait
echo.
echo Waiting for Node N1 to go down...
dvcomand wait 50
goto 2diffn2
:diffn3
rem>c:\fd\n1\fdexit.255
rem>c:\fd\n2\fdexit.255
:3diffn3
if not exist c:\ra\n1down.txt goto n3wait
if not exist c:\ra\n2down.txt goto n3wait
goto dofidodiffs
:n3wait
echo.
echo Waiting on Node(s) to go down for Diff processing...
dvcomand wait 50
goto 3diffn3
:dofidodiffs
copy c:\fd\files\nodediff.* c:\files\diffs
daynbr /-14 /d5 del c:\fd\nodelist\save\nodelist.@###
daynbr /-7 /d5 copy c:\fd\nodelist\nodelist.@### c:\fd\nodelist\save
sysnl merge nodelist nodediff c
daynbr /-7 /d5 del c:\fd\nodelist\nodelist.@###
daynbr /-7 /d5 del c:\files\diffs\nodelist.@Z##
daynbr /-35 /d5 del c:\files\diffs\nodediff.@A##
daynbr /d5 pkzip c:\files\diffs\nodelist.@Z## nodelist.@###
goto compile
:compile
c:
cd\fd\n1
fdnc /f
cd\ra\%node%
ranode
goto nodelist
:unpackmail
echo.
echo Checking to see if FD Node(s) are down...
if exist c:\ra\n?down.txt goto openfdnodes
goto nodesup
:openfdnodes
echo .
echo Bringing FD Node(s) back online...
if exist c:\fd\n1\fdexit.255 del c:\fd\n1\fdexit.255
if exist c:\fd\n2\fdexit.255 del c:\fd\n2\fdexit.255
if exist c:\ra\n1down.txt dvcomand open c:\dv\n1
if exist c:\ra\n2down.txt dvcomand open c:\dv\n2
:nodesup
echo.
echo Tossing INBOUND mail...
echo.>>c:\logs\inbound.log
echo Node %node% tossed this mail bundle.>>c:\logs\inbound.log
c:
cd\ra\%node%
imail toss
mbutil import
mbutil link -clean
rem>c:\fd\n1\fdrescan.now
rem>c:\fd\n1\fmrescan.now
rem>c:\fd\n2\fdrescan.now
rem>c:\fd\n2\fmrescan.now
if exist c:\ra\mail!.txt del c:\ra\mail!.txt
if exist c:\ra\N?toss.txt del c:\ra\N?toss.txt
if exist c:\ra\%node%inchck.txt goto back2update
if exist c:\ra\%node%outchk.txt goto backfromtoss
if %node% == N3 goto N3exit
goto start
:ralocal
if %node% == N1 goto tosschk1l
if %node% == N2 goto tosschk2l
if %node% == N3 goto tosschk3l
:tosschk1l
if exist c:\ra\N2toss.txt goto fdbusyl
if exist c:\ra\N3toss.txt goto fdbusyl
:tosschk2l
if exist c:\ra\N1toss.txt goto fdbusyl
if exist c:\ra\N3toss.txt goto fdbusyl
:tosschk3l
if exist c:\ra\N1toss.txt goto fdbusyl
if exist c:\ra\N2toss.txt goto fdbusyl
echo.
echo Notifying other nodes that this node is online...
rem>c:\ra\%node%isup.txt
set oldport=%port%
set port=0
c:
cd\ra\%node%
ra -%node% -l -e20
set port=%oldport%
set oldport=
goto afterra
:fdbusyl
type c:\ra\fdbusy.txt
dvcomand wait 50
goto start
:fdbusy
echo.
echo Notifying user of System Maintainence in progress.
echo.
type c:\ra\fdbusy.txt > com%port%:
dtr com%port%: off
dtr com%port%: on
at com%port%: h1
goto start
:outbound
if %node% == N1 goto downnode
if %node% == N2 goto downnode
if %node% == N3 goto nodeupout
:downnode
dtr com%port%: off
dtr com%port%: on
at com%port%: h1
if %node% == N2 goto nodeupout
if %node% == N1 goto nodeupout
:nodeupout
echo.
echo Checking for waiting INBOUND mail...
if not exist c:\ra\mail!.txt goto jump
echo.
echo We have waiting INBOUND mail. Going to toss it now...
rem>c:\ra\%node%outchk.txt
goto inbound
:jump
:backfromtoss
echo.
echo Checking for another node online...
if exist c:\ra\%node%outchk.txt del c:\ra\%node%outchk.txt
if %node% == N1 goto 1echoloop
if %node% == N2 goto 2echoloop
if %node% == N3 goto 3echoloop
:1echoloop
if not exist c:\ra\N2isup.txt goto chk3
echo.
echo Node N2 is online. Waiting till later to scan OUTBOUND mail...
goto start
:2echoloop
if not exist c:\ra\N1isup.txt goto chk3
echo.
echo Node N1 is online. Waiting till later to scan OUTBOUND mail...
goto start
:3echoloop
if not exist c:\ra\N1isup.txt goto chk2
echo.
echo Node N1 is online. Waiting till later to scan OUTBOUND mail...
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
goto end
:chk2
if not exist c:\ra\N2isup.txt goto echook
echo.
echo Node N2 is online. Waiting till later to scan OUTBOUND mail...
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
goto end
:chk3
if not exist c:\ra\N3isup.txt goto echook
echo.
echo Node N3 is online. Waiting till later to scan OUTBOUND mail...
goto start
:echook
echo.
echo Scanning for OUTBOUND mail...
c:
cd\ra\%node%
if exist c:\ra\msgbase\echomail.bbs del c:\ra\msgbase\echomail.bbs
if exist c:\ra\msgbase\netmail.bbs del c:\ra\msgbase\netmail.bbs
mbutil export
imail scan
rem>c:\fd\n1\fdrescan.now
rem>c:\fd\n1\fmrescan.now
rem>c:\fd\n2\fdrescan.now
rem>c:\fd\n2\fmrescan.now
:update
echo.
echo Attempting to update user bulletins...
if %node% == N3 goto lookup
dtr com%port%: off
dtr com%port%: on
at com%port%: h1
:lookup
if not exist c:\ra\mail!.txt goto jump1
rem>%node%inchck.txt
goto inbound
:jump1
:back2update
if exist c:\ra\msgs\echomail.bbs goto outbound
if exist c:\ra\msgs\netmail.bbs goto outbound
if %node% == N1 goto check1
if %node% == N2 goto check2
if not exist c:\ra\N1isup.txt goto chck2
echo.
echo Node N1 is online. Waiting till later to update bulletins...
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
goto end
:check2
if not exist c:\ra\N1isup.txt goto chck3
echo.
echo Node N1 is online. Waiting till later to update bulletins...
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
goto start
:check1
if not exist c:\ra\N2isup.txt goto chck3
echo.
echo Node N2 is online. Waiting till later to update bulletins...
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
goto start
:chck2
if not exist c:\ra\N2isup.txt goto doupdate
echo.
echo Node N2 is online. Waiting till later to update bulletins...
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
goto end
:chck3
if not exist c:\ra\N3isup.txt goto doupdate
echo.
echo Node N3 is online. Waiting till later to update bulletins...
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
goto start
:doupdate
usa
:n3exit
del c:\ra\%node%isup.txt
if %node% == N3 goto end
goto start
:nightly
dtr com%port%: off
dtr com%port%: on
at com%port%: h1
if exist c:\ra\N1isup.txt del c:\ra\N1isup.txt
if exist c:\ra\N2isup.txt goto wait
if exist c:\ra\N2toss.txt goto wait
if exist c:\ra\N3isup.txt goto wait
if exist c:\ra\N3toss.txt goto wait
echo.
echo Running Nightly Maintenance...
rem>c:\ra\N1toss.txt
call c:\ra\runmaint.bat
goto start
:wait
echo.
echo Waiting on another node so I can run nightly maintenance...
dvcomand wait 100
goto nightly
:weekly
if %node% == N1 dtr com%port%: on
if %node% == N1 at com%port%: h1
if %node% == N2 goto start
if exist c:\ra\N1isup.txt del c:\ra\N1isup.txt
if exist c:\ra\N2isup.txt goto wwait
if exist c:\ra\N2toss.txt goto wwait
if exist c:\ra\N3isup.txt goto wwait
if exist c:\ra\N3toss.txt goto wwait
echo.
echo Running Weekly Maintenance...
rem>c:\ra\N1toss.txt
imthings stat
goto start
:wwait
echo.
echo Waiting on another node so I can run weekly maintenance...
dvcomand wait 100
goto weekly
:enderror
cls
echo Node %node% is down with a FATAL error!
echo Attempting to reload and correct in 5 seconds..
dvcomand wait 50
bnu /c
goto start
:endok
cls
dtr com%port%: off
dtr com%port%: on
at com%port%: h1
:endok2
echo Node %node% has been exited normally. The phone is unuseable.
:end
if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
if exist c:\ra\%node%load.txt del c:\ra\%node%load.txt
rem>c:\ra\%node%down.txt
:endok3
dvactive
if errorlevel 1 exit
bnu /u